import request from '@/utils/request'

export default {
  // 1、添加课程信息
  addCourseInfo(courseInfo) {
    return request({
      url: `/eduService/edu-course/addCourseInfo`,
      method: 'post',
      data:courseInfo
    })
  },
  getListTeacher() {
    return request({
      url: `/eduService/edu-teacher/findAll`,
      method: 'get'
    })
  },
  //根据课程id查询课程基本信息
  getCourseInfoId(id) {
    return request({
      url: '/eduService/edu-course/getCourseInfo/'+id,
      method: 'get'
    })
  },
  //修改课程信息
  updateCourseInfo(courseInfo) {
    return request({
      url: '/eduService/edu-course/updateCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  //课程信息确认
  getPublishCourseInfo(id){
    return request({
      url: `/eduService/edu-course/getPublishCourseInfo/${id}`,
      method: 'get'
    })
  },
  //课程最终发布
  publishCourse(id){
    return request({
      url: `/eduService/edu-course/publishCourse/${id}`,
      method: 'post'
    })
  },
  //TODO 课程列表
  getListCourse(current,limit){
    return request({
      url:`/eduService/edu-course/getCourseList/${current}/${limit}`,
      method:'get'
    })
  },
  deleteCourse(id){
    return request({
      url:`/eduService/edu-course/${id}`,
      method:'delete'
    })
  }
}
